/*
 * ©  2013
 * All Rights Reserved
 */
package dieci.managers.salesmanager;

import dieci.database.sales.SaleHibernateDAO;
import dieci.system.Sale;
import java.util.List;

/**
 *
 * @author DuckSys
 */
public class SalesManager
{

    public SalesManager()
    {
        this.saleDAO = new SaleHibernateDAO();
    }

    public void saveSale(Sale sale)
    {
        //call prod dao to save the sale in db
        saleDAO.saveOrUpdate(sale);
    }

    public void deleteSale(Sale sale)
    {
        saleDAO.delete(sale);
    }

    public Sale find(long saleId)
    {
        return saleDAO.findBySaleId(saleId);
    }

    public List<Sale> list()
    {
        return saleDAO.list();
    }
    private SaleHibernateDAO saleDAO;
}
